package com.bite.system.controller;

import com.bite.common.redis.service.RedisService;
import com.bite.system.domain.sysuser.SysUser;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/q1")
public class TestRedis {

    @Resource
    private RedisService redisService;

    @RequestMapping("/test")
    public String getAanAdd() {
        SysUser sysUser = new SysUser();
        sysUser.setUserAccount("RedisTest");
        String key = "u";
        redisService.setCacheObject(key,sysUser);
        SysUser u = redisService.getCacheObject(key, SysUser.class);
        return u.toString();
    }
}
